package cn.tedu.csmall.product.web;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class JsonResult implements Serializable {

    private Integer state;
    private String message;

    public static JsonResult ok(){
        JsonResult jsonResult=new JsonResult();
        jsonResult.state=ServiceCode.OK;
        return jsonResult;
    }

    public static JsonResult fail(Integer state,String message){
        JsonResult jsonResult=new JsonResult();
        jsonResult.state=state;
        jsonResult.message=message;
        return jsonResult;
    }
}
